function People(name,age){
    // 私有属性
    var password = "admin888";
    // 特权方法
    this.getPassword = function(){
        return password;
    }

    // 对象属性
    this.name = name;
    this.age = age;
}

// 原型方法
People.prototype.say = function(){
    console.log(this.name+"说:他的年龄是"+this.age);
}
People.prototype.run = function(){
    console.log("我的名字是:"+this.name+",今年"+this.age+"岁，我在努力的奔跑中...");
}

// 静态属性
People.sex = "男";
// 静态方法
People.sleep = function(){
    console.log(People.sex+"人正在休息!");
}

// 访问静态属性和方法
console.log(People.sex);
People.sleep();
console.log("-------------------------");

// 访问对象属性和方法
var people = new People("王五",26);
console.log(people.name);
console.log(people.age);
people.say();
people.run();
console.log("-------------------------");

// 访问私有属性
console.log(people.name+"的密码是:"+people.getPassword());
